#ifndef _H_I_TO_SERVICE_ADAPTER_MSG_H_
#define _H_I_TO_SERVICE_ADAPTER_MSG_H_

#include "../typedefine.h"
#include "IServiceMsg.h"
#include "EServiceMsgType.h"
#include "../promise.h"

namespace QWER
{
	QCLASS IServiceBackend;
	class IServiceFrontend;
	template<typename T> class CPromise;

	QDLL_EXPORT QCLASS IToServiceFrontendMsg QABSTRACT : public IServiceMsg
	{
	public:
		virtual EServiceMsgType GetMsgType() QCONST_FUNC QOVERRIDE
		{
			return EServiceMsgType::ToAdapterMsg;
		}

	protected:
		virtual CPromise<BOOLN>* _OnRecv() QOVERRIDE;
		virtual CPromise<BOOLN>* _OnCall(PTR_OR_REF(IServiceFrontend) roAdapter) = 0;

#ifdef _USING_CLI
	internal:
#else
	private:
		friend class CServiceBackendHelper;
#endif
		IServiceFrontend* m_poFrontend = NULL_PTR;
		UINT32 m_dwServiceID = 0;
	};
}

#endif
